//        https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1




#include<iostream>
#include <unordered_set>
using namespace std;

int main()
{
    string str;
    cin >> str;

    unordered_set<char> set;

    for (auto i = str.rbegin(); i != str.rend(); i++)
    {
        if (set.count(*i))
            continue;
        set.insert(*i);
        cout << *i;
    }

    return 0;
}